package com.simtop.hj.utils;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class PropertiesUtils {

    static Properties  properties=new Properties();
    static InputStream in = PropertiesUtils.class.getResourceAsStream("/cx.properties");
    public static String getMc(){
        String value="";
        try {
            properties.load(new InputStreamReader(in));
             value = properties.getProperty("mc");
            if (value == null)
                return null;

            // 编码转换，从ISO8859-1转向指定编码
            value = new String(value.getBytes("ISO8859-1"), "utf8");
        } catch (IOException e) {
            e.printStackTrace();
        }

        return value;
    }

    public static String getDc(){
        try {
            properties.load(new InputStreamReader(in));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return properties.getProperty("dc");
    }

    public static String getXrc(){
        try {
            properties.load(new InputStreamReader(in));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return properties.getProperty("xrc");
    }
}
